package com.mentaleye.enumpackage;

public enum Status {
	NOMAL(1, "正常"), DELETE(2, "删除");

	private Integer code;
	private String msg;

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	private Status(Integer code, String msg) {

		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	/**
	 * 根据编码查找枚举
	 */
	public static Status find(int code) {
		for (Status frs : Status.values()) {
			if (frs.getCode().intValue() == code) {
				return frs;
			}
		}
		return null;
	}
}
